import { useRef } from 'react'

import './App.css'
import Moveable from "react-moveable";

function App() {
  const targetRef = useRef<HTMLDivElement>(null);
  return (
    <>
      <div className="root">
        <div className="container">
          <div className="target" ref={targetRef} style={{
            transform: "translate(0px, 0px) rotate(0deg)",
          }}></div>
          <Moveable
            className='Moveable'
            target={targetRef}
            rotatable={true}
            throttleRotate={0}
            rotationPosition={"bottom"}
            onRotate={e => {
              e.target.style.transform = e.drag.transform;
            }}
          />

          <button className='btn'>移动</button>
        </div>
      </div>
    </>
  )
}

export default App
